package ${module.daoImplPackage};

import javax.persistence.criteria.CriteriaQuery;

import org.springframework.stereotype.Repository;

import ${frameworkPackage}.dao.BasicDao;
import ${frameworkPackage}.general.Page;
import ${frameworkPackage}.general.Paging;
import ${frameworkPackage}.general.Searching;
import ${frameworkPackage}.general.Sorting;
import ${beanModule.entityPackage}.${entityName};
import ${beanModule.searchPackage}.${entityName}4Search;
import ${module.daoPackage}.${entityName}Dao;


/**
 * @author Moyq5's MvcMaker Tools
 */
@Repository
public class ${entityName}DaoImpl extends BasicDao<${entityName}> implements ${entityName}Dao {

	public ${entityName}DaoImpl() {
		super(${entityName}.class);
	}

	@Override
	protected CriteriaQuery<${entityName}> createExampleQuery(${entityName} ${lowerName}, String searchWord) {
		CriteriaQuery<${entityName}> c = super.createExampleQuery(${lowerName}, searchWord);
		// TODO 在这里实现关联表对象属性（条件）的查询和关键字（searchWord）查询
		return c;
	}
	
	@Override
	public Page<${entityName}> page(${entityName}4Search ${lowerName}4s, Searching si) {
		CriteriaQuery<${entityName}> c = createExampleQuery(${lowerName}4s, si.getSearchWord());
		// TODO 在这里实现其它属性（条件）的查询
		return page(c, (Sorting)si, (Paging)si);
	}
	
}
